$(window).scroll(function(){
　　var scrollTop = $(this).scrollTop();
　　var scrollHeight = $(document).height();
　　var windowHeight = $(this).height();
　　if(scrollTop + windowHeight == scrollHeight){
　　　　$.ajax({
			type:"get",
			dataType: "json",
			url:"/getpaper/"+lastid,
			success:function(msg){
				for (var i = 0; i<msg.tasks[0].length ; i++){
					title = msg.tasks[0][i].title
					link  = msg.tasks[0][i].link
					$content.append("<div class='post'><div class='title'><a target=\"_blank\" href=\""+link+"\">"+title+"</a></div></div>")
				}
				lastid = tmpid;
				tmpid  = tmpid - 9;
			},
			async: false
		})
　　}
});
$.ajaxSetup({ async :false});
var lastid =10;
var tmpid =10;
var $content = $('#container');
$.ajax({
	type:"get",
	dataType: "json",
    url:"/getlastid/",
    success:function(msg){
		lastid = msg.tasks[0].date;
		tmpid = lastid - 9;
	},
    async: false
 })
while (document.getElementById("container").offsetHeight <=window.screen.availHeight){
	$.ajax({
	type:"get",
	dataType: "json",
    url:"/getpaper/"+lastid,
    success:function(msg){
		for (var i = 0; i<msg.tasks[0].length ; i++){
			title = msg.tasks[0][i].title
			link  = msg.tasks[0][i].link
			$content.append("<div class='post'><div class='title'><a target=\"_blank\" href=\""+link+"\">"+title+"</a></div></div>")

		}
		lastid = tmpid;
		tmpid  = tmpid - 9;
	},
    async: false
 })
}




if (document.documentElement.scrollHeight>= document.documentElement.clientHeight){
	console.log("有");
}
else{
	console.log("没有");
}
console.log(document.getElementById("container").offsetHeight)
console.log(window.screen.availHeight)

